package com.xgb.websocket.controller;

import org.springframework.messaging.handler.annotation.MessageMapping;
import org.springframework.messaging.handler.annotation.SendTo;
import org.springframework.stereotype.Controller;

import com.xgb.websocket.model.InMessage;
import com.xgb.websocket.model.OutMessage;

@Controller
public class WebSocketv1Controller {
	
	/**
	 * SendTo注解 发送给那个订阅的目的地
	 * @param message
	 * @return
	 */
	@MessageMapping("/v1/chat")
	@SendTo("/topic/game_chat")
	public OutMessage gameInfo(InMessage message){
		
		return new OutMessage(message.getContent());
	}

}
